/*
 * @Author: 邱狮杰
 * @Date: 2021-09-04 20:24:05
 * @LastEditTime: 2021-09-05 11:11:19
 * @FilePath: /new-hope/src/utils/prizeClassification.ts
 * @Description: 描述
 */
import subcodeWinningMilk from "/@/assets/images/subcodeWinningMilk.png"; // 低脂奥特兰奶一箱 -> 填写收奖信息领取
import subcodeNecklace from "/@/assets/images/subcodeNecklace.png"; // 项链
import subcodeAltlandDiamonds from "/@/assets/images/subcodeAltlandDiamonds.png"; // 钻石
import diamonds from "/@/assets/images/prize/diamonds.png";
import milk from "/@/assets/images/prize/mike.png";
import preferentialAward from "/@/assets/images/prize/preferentialAward.png"; // 优惠卷
import xianglia from "/@/assets/images/prize/xianglian-01.png";
import videoMember from "/@/assets/images/prize/videoMember.png";
import redEnvelopes from "/@/assets/images/prize/redEnvelopes.png";
// preferentialAward
// {title: "澳特兰钻石", type: "diamond", pic: "https://act.yoois.com/zt/qr2/img/diamond.jpg"}
// 1: {title: "施华洛世奇联名项链", type: "necklace", pic: "https://act.yoois.com/zt/qr2/img/necklace.jpg"}
// 2: {title: "低脂澳特兰奶一件", type: "milk", pic: "https://act.yoois.com/zt/qr2/img/milk.jpg"}
// 3: {title: "腾讯视频月度会员", type: "member", pic: "https://act.yoois.com/zt/qr2/img/member.jpg"}
// 4: {title: "现金红包", type: "redpacket", pic: "https://act.yoois.com/zt/qr2/img/redpacket.jpg"}
// 5: {title: "新希望华西商城满减优惠券", type: "coupon", pic:
const prizeMap = new Map<string, number>();
prizeMap.set("diamond", 1);
prizeMap.set("necklace", 2);
prizeMap.set("milk", 3);
prizeMap.set("member", 4);
prizeMap.set("redpacket", 5);
prizeMap.set("coupon", 6);

const prizeMaps = new Map<string, string>();
prizeMaps.set("diamond", diamonds);
prizeMaps.set("necklace", xianglia);
prizeMaps.set("milk", milk);
prizeMaps.set("member", videoMember);
prizeMaps.set("redpacket", redEnvelopes);
prizeMaps.set("coupon", preferentialAward);

export function getPrizeID(prizeType: string): number {
  return prizeMap.get(prizeType) as number;
}

export function getSrc(type: string) {
  const id = getPrizeID(type);
  if (id === 1) return subcodeAltlandDiamonds; // 钻石
  if (id === 2) return subcodeNecklace;
  if (id === 3) return subcodeWinningMilk;
  return "";
}

export function getPrizeSrc(type: string) {
  return prizeMaps.get(type);
}
